package com.woniuxy.oldmanapi.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.oldmanapi.entity.RechargeRecord;
import com.woniuxy.oldmanapi.mapper.RechargeRecordMapper;
import com.woniuxy.oldmanapi.vo.RecordVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RecordService {

    @Autowired
    RechargeRecordMapper recordMapper ;

    public PageInfo<RecordVo> findRecordByPage(Integer now, Integer size,String name) {
        PageHelper.startPage(now,size);
        List<RecordVo> RecordVoList =  recordMapper.selectRecordByCons(name);
        return new PageInfo<>(RecordVoList);
    }

    public void recharge(RechargeRecord record) {
        recordMapper.insert(record);
    }
}
